<template>
  <div class="goods_cell">
    <div class="image_box">
      <nuxt-link :to="`/shop/${info.id}`">
        <li-image :src="$getLogo(info.logo)" class="img" v-if="info.logo" :alt="`${info.name}`" />
        <img src="@/assets/images/avatar/goods_default.png" class="img" :alt="`${info.name}`" v-else />
      </nuxt-link>
    </div>
    <div class="info">
      <div class="title">
        <nuxt-link :to="`/shop/${info.id}`">{{ info.name }}</nuxt-link>
      </div>
      <div class="price">
        <span class="unit">￥</span><span class="num">{{ info.price }}</span>
      </div>
      <div class="sale">销量:{{ info.initAppointmentCnt }}</div>
    </div>
  </div>
</template>
<script>
import qs from "qs";
//import navigator from '@/utils/navigator'
export default {
  name: "Goods",
  props: {
    info: {
      type: Object,
      default: function () {
        return {};
      },
    },
  },
  data() {
    return {};
  },
  methods: {
    // 查看详情
    lookDetail() {
      let params = {};
      let o = this.info;
      params.id = o.id;
      // query.random = Math.random()
      // let _path = `/shop/detail?${qs.stringify(query)}`
      // console.log(_path)
      // window.location.replace(_path)
      // this.$router.replace({
      //     path: _path,
      // })
      this.$routerPush("/shop/detail", params);
    },
  },
};
</script>
<style lang="less" scoped>
@import "./index.less";
</style>